/**
 */
package org.mro.grib.model.files.secondEdition.products.impl;

import java.nio.ByteBuffer;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.mro.grib.model.files.secondEdition.products.ProductDefinitionTemplate415;
import org.mro.grib.model.files.secondEdition.products.ProductsPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Product Definition Template415</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.mro.grib.model.files.secondEdition.products.impl.ProductDefinitionTemplate415Impl#getStatisticalProcess <em>Statistical Process</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.products.impl.ProductDefinitionTemplate415Impl#getTypeOfSpatialProcessing <em>Type Of Spatial Processing</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.products.impl.ProductDefinitionTemplate415Impl#getNumberOfDataPoints <em>Number Of Data Points</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ProductDefinitionTemplate415Impl extends ProductDefinitionTemplate40Impl implements ProductDefinitionTemplate415 {
	/**
	 * The default value of the '{@link #getStatisticalProcess() <em>Statistical Process</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStatisticalProcess()
	 * @generated
	 * @ordered
	 */
	protected static final byte STATISTICAL_PROCESS_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getStatisticalProcess() <em>Statistical Process</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStatisticalProcess()
	 * @generated
	 * @ordered
	 */
	protected byte statisticalProcess = STATISTICAL_PROCESS_EDEFAULT;

	/**
	 * The default value of the '{@link #getTypeOfSpatialProcessing() <em>Type Of Spatial Processing</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTypeOfSpatialProcessing()
	 * @generated
	 * @ordered
	 */
	protected static final byte TYPE_OF_SPATIAL_PROCESSING_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getTypeOfSpatialProcessing() <em>Type Of Spatial Processing</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTypeOfSpatialProcessing()
	 * @generated
	 * @ordered
	 */
	protected byte typeOfSpatialProcessing = TYPE_OF_SPATIAL_PROCESSING_EDEFAULT;

	/**
	 * The default value of the '{@link #getNumberOfDataPoints() <em>Number Of Data Points</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumberOfDataPoints()
	 * @generated
	 * @ordered
	 */
	protected static final byte NUMBER_OF_DATA_POINTS_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getNumberOfDataPoints() <em>Number Of Data Points</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumberOfDataPoints()
	 * @generated
	 * @ordered
	 */
	protected byte numberOfDataPoints = NUMBER_OF_DATA_POINTS_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ProductDefinitionTemplate415Impl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ProductsPackage.Literals.PRODUCT_DEFINITION_TEMPLATE415;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getStatisticalProcess() {
		return statisticalProcess;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStatisticalProcess(byte newStatisticalProcess) {
		byte oldStatisticalProcess = statisticalProcess;
		statisticalProcess = newStatisticalProcess;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__STATISTICAL_PROCESS, oldStatisticalProcess, statisticalProcess));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getTypeOfSpatialProcessing() {
		return typeOfSpatialProcessing;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTypeOfSpatialProcessing(byte newTypeOfSpatialProcessing) {
		byte oldTypeOfSpatialProcessing = typeOfSpatialProcessing;
		typeOfSpatialProcessing = newTypeOfSpatialProcessing;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__TYPE_OF_SPATIAL_PROCESSING, oldTypeOfSpatialProcessing, typeOfSpatialProcessing));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getNumberOfDataPoints() {
		return numberOfDataPoints;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNumberOfDataPoints(byte newNumberOfDataPoints) {
		byte oldNumberOfDataPoints = numberOfDataPoints;
		numberOfDataPoints = newNumberOfDataPoints;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__NUMBER_OF_DATA_POINTS, oldNumberOfDataPoints, numberOfDataPoints));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__STATISTICAL_PROCESS:
				return getStatisticalProcess();
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__TYPE_OF_SPATIAL_PROCESSING:
				return getTypeOfSpatialProcessing();
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__NUMBER_OF_DATA_POINTS:
				return getNumberOfDataPoints();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__STATISTICAL_PROCESS:
				setStatisticalProcess((Byte)newValue);
				return;
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__TYPE_OF_SPATIAL_PROCESSING:
				setTypeOfSpatialProcessing((Byte)newValue);
				return;
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__NUMBER_OF_DATA_POINTS:
				setNumberOfDataPoints((Byte)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__STATISTICAL_PROCESS:
				setStatisticalProcess(STATISTICAL_PROCESS_EDEFAULT);
				return;
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__TYPE_OF_SPATIAL_PROCESSING:
				setTypeOfSpatialProcessing(TYPE_OF_SPATIAL_PROCESSING_EDEFAULT);
				return;
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__NUMBER_OF_DATA_POINTS:
				setNumberOfDataPoints(NUMBER_OF_DATA_POINTS_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__STATISTICAL_PROCESS:
				return statisticalProcess != STATISTICAL_PROCESS_EDEFAULT;
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__TYPE_OF_SPATIAL_PROCESSING:
				return typeOfSpatialProcessing != TYPE_OF_SPATIAL_PROCESSING_EDEFAULT;
			case ProductsPackage.PRODUCT_DEFINITION_TEMPLATE415__NUMBER_OF_DATA_POINTS:
				return numberOfDataPoints != NUMBER_OF_DATA_POINTS_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (statisticalProcess: "); //$NON-NLS-1$
		result.append(statisticalProcess);
		result.append(", typeOfSpatialProcessing: "); //$NON-NLS-1$
		result.append(typeOfSpatialProcessing);
		result.append(", numberOfDataPoints: "); //$NON-NLS-1$
		result.append(numberOfDataPoints);
		result.append(')');
		return result.toString();
	}

	/* (non-Javadoc)
	 * @see org.mro.grib.model.files.secondEdition.products.impl.ProductDefinitionTemplate40Impl#initialise(java.nio.ByteBuffer)
	 */
	@Override
	public void initialise(ByteBuffer buffer) {
		super.initialise(buffer);
		statisticalProcess = buffer.get();
		typeOfSpatialProcessing = buffer.get();
		numberOfDataPoints = buffer.get();
	}
	
} //ProductDefinitionTemplate415Impl
